package com.jt.control;

import com.jt.bean.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sound.midi.Soundbank;

@RestController
@PropertySource(value = "classpath:properties/hello.properties",encoding = "utf-8")
public class HelloControl {

    @Value("${hello.msg}")
    private   String  message;

    @Value("${jt.msg}")
    private   String  massage2;


    public void setMessage(String message) {
        System.out.println("调用了set方法================================");
        System.out.println("调用了set方法================================");
        this.message = message;
    }

    @RequestMapping("/hello")
    public  String  hello(){
        User  user=new User();
        user.setUsername("小名").setPassword("123456").setAge(10);
        System.out.println(user);
        return  message+massage2;
    }


}
